import time

import unittest
from selenium import webdriver
from selenium.webdriver import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

class TestJDLogin(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        cls.driver = webdriver.Edge()
        cls.driver.maximize_window()

    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()

    def test_login(self):
        '''
        func:网易邮箱登录Case
        :return:
        '''

        # self.driver.get("https://mail.163.com")
        # time.sleep(10)
        # 定位用户名输入框并输入用户名
        self.driver.get("https://www.jd.com")
        wait = WebDriverWait(self.driver, 10)
        time.sleep(10)
        # # 点击登录链接
        # login_link = self.driver.find_element(By.CLASS_NAME, "link-login")
        # login_link.click()
        #
        # time.sleep(5)
        # # element = self.driver.find_element(By.XPATH, "//*[contains(text(), '密码登录')]")
        # element = self.driver.find_element(By.LINK_TEXT, "密码登录")
        # print(element.text)



if __name__ == "__main__":
    unittest.main()